<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><!--@php  echo $goods['title'];@--></title>
 <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<link rel='stylesheet' type='text/css' href='__RESOURCE__/recouse/css/bjdetail.css' />
    <link href="__RESOURCE__/recouse/css/reset.css" rel="stylesheet" type="text/css" />
	<link href="__RESOURCE__/recouse/css/bjcommon.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="__RESOURCE__/recouse/js/jquery-1.7.2.min.js"></script>
	<script src="__RESOURCE__/recouse/js/jquery.json.js" type="text/javascript"></script>
	<script type="text/javascript" src="__RESOURCE__/recouse/js/common.js"></script>
	<script type="text/javascript" src="__RESOURCE__/recouse/js/transport.js"></script>
	<script type="text/javascript" src="__RESOURCE__/recouse/js/utils.js"></script>
<script type="text/javascript" src="__RESOURCE__/recouse/js/jquery.lazyload.min.js"></script>
<script type="text/javascript" charset="utf-8">
      $(function() {
          $("img").lazyload({ 
		  placeholder : "__RESOURCE__/recouse/images/ajax-loader.gif", // 占位图
		threshold : 200, //控制灵敏度
                 effect: "fadeIn"
           });  
      });
</script>
</head>
<body style=" margin:0 auto;">



<div class="main">


	<section class="sp">
<div class="product-intro">
	
	<div id="cont_show">
<script type="text/javascript" src="__RESOURCE__/recouse/js/jquery.flexslider-min.js"></script>
<script type="text/javascript">
$(function() {
	$('.flexslider').flexslider({
		 animation: "slide",
		 slideDirection: "horizontal"
	 });
	$("#btn_continue").click(function(){
		$("#buy_lay").hide();
		$("#buy_lay_frm").hide();
	});
	$("#btn_check").click(function(){
		window.location='cart.php';
	});	 
	$(document).bind("click",function(){
		$("#buy_lay").hide();
		$("#buy_lay_frm").hide();
	});
});
</script>
<script type="text/javascript">
var $$ = function (obj) {
    if (obj != null && obj != undefined && obj.toString().length > 0) {
        if (obj[0] == '#') {
            return document.getElementById(obj.substr(1, obj.length - 1));
        }
    }
}
function chgNum(a) {
    var number = $$("#total");
    var p = parseInt(number.value);
    if (a == 1) {
        if (p < 1038) number.value = ++p;
    }
    else {
        if (p > 1) number.value = --p;
    }
}
</script>
<link href="__RESOURCE__/recouse/css/flexslider.css" rel="stylesheet" type="text/css" />
<div id="viewport" class="viewport">

<div class="show">
	<div class="slider card card-nomb" style="visibility: visible;">
    <script type="text/javascript" src="__RESOURCE__/recouse/js/TouchSlide.1.1.js"></script>
    <div id="focus" class="focus">
      <div class="hd">
        <ul>
        </ul>
      </div>
      <div class="bd">
        <ul>
       <!--@php  if(is_array($piclist)) { foreach($piclist as $row) { @-->
        <li><img src="<!--@php echo WEBSITE_ROOT;@-->/attachment/<!--@php  echo $row['attachment'];@-->"  /></li>
		<!--@php  } } @-->
        </ul>
      </div>
    </div>
    <script type="text/javascript">
	TouchSlide({ 
		slideCell:"#focus",
		titCell:".hd ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
		mainCell:".bd ul",
		delayTime:600,
		interTime:4000,
		effect:"leftLoop", 
		autoPlay:true,//自动播放
		autoPage:true, //自动分页
		switchLoad:"_src" //切换加载，真实图片路径为"_src" 
	});
	</script>
    <!-- banner轮播End -->
  </div>
</div>
</div>

<div class="pro-info">
<p class="pro-name"><strong><!--@php  echo $goods['title'];@--></strong></br></p>


<div class="price clearfix">
<p class="jx-price">价&nbsp;&nbsp;&nbsp;格<strong style=" padding-left:15px" id="marketprice">￥<!--@php  echo $marketprice;@--> </strong><!--@php  if($goods['issendfree']==1) { @--><span><img src="__RESOURCE__/recouse/images/baoyou.png"></span><!--@php  } @--></p>



</div>
<!--@php  if($marketprice < $productprice) { @-->
<div class="price clearfix">
<p class="jx-pricem">市场价<strong style=" padding-left:15px;color:#BEBEBE" id="productprice">￥<!--@php  echo $productprice;@--></strong></p> 
</div>


<div class="goods_number clearfix">
	<p class="name">货&nbsp;&nbsp;&nbsp;号</p>
<strong style=" padding-left:15px;color:#BEBEBE" ><!--@php  echo $goods['goodssn'];@--></strong>
</div>
<!--@php  } @-->
<!--@php  if($goods['istime']==1) { @-->
<div class="price clearfix">
<p class="jx-price">倒计时：<strong style=" padding-left:15px;color:#ff0500;font-size: 16px;"><em id="time_<!--@php  echo $goods['id'];@-->"><!--@php  echo $goods['timelaststr'];@--></em></strong></p> 
</div>
<script language='javascript'>
                     var total_time_<!--@php  echo $goods['id'];@--> = <!--@php  echo $goods['timelast'];@-->;  
                         var int_time_<!--@php  echo $goods['id'];@-->  = setInterval(function(){
                             d(<!--@php  echo $goods['id'];@-->);
                         },1000);
                     </script>

<script type="text/javascript">


          
function d(id){
            eval("total_time_" + id+"--");
            var total_time = eval("total_time_" + id);
          
           var days = parseInt(total_time/86400)
           
           var remain = parseInt(total_time%86400);
            var hours = parseInt(remain/3600)
              var remain = parseInt(remain%3600);
    
     var mins = parseInt(remain/60);
     var secs = parseInt(remain%60);
     
            if (total_time <= 0) {
                $("#time_" + id).html( "时间到了");
                var int_time =  eval("int_time_" + id);
                window.clearInterval(int_time);
          
            } else {
                
                var ret = "";
                if(days>0){
                    days = days+"";
                    if(days.length<=1) { days="0"+days;}
                    ret+=days+" 天 ";
                }
                if(hours>0){
                    hours = hours+"";
                    if(hours.length<=1) { hours="0"+hours;}
                    ret+=hours+":";
                }
                if(mins>0){
                        mins = mins+"";
                    if(mins.length<=1) { mins="0"+mins;}
                    ret+=mins+":";
                }
              
                       secs = secs+"";
                     if(secs.length<=1) { secs="0"+secs;}
                     ret+=secs;
             
     
                $("#time_" + id).html( ret);
            }
        }

</script>

<!--@php  } @-->
<!--<div class="price clearfix">
<p class="jx-price">已&nbsp;&nbsp;&nbsp;售:<strong style=" padding-left:15px;color:#BEBEBE; "><!--@php  echo $goods['sales'];@--></strong></p> 
</div>-->

<!--@php  if($goods['istime']==1&&$stock!=-1) { @-->
<div class="price clearfix">
<p class="jx-price">剩&nbsp;&nbsp;&nbsp;余:<strong style=" padding-left:15px;color:#BEBEBE; " id="goodstotail"><!--@php  echo $stock;@--></strong></p> 
</div>
<!--@php  } @-->
<!--
<!--@php  if($member) { @-->
<!--@php  if($member['flag']==1) { @-->
<!--@php  if($commission !=0) { @-->
<div class="price clearfix">
<p class="jx-price">佣&nbsp;&nbsp;&nbsp;金<strong style=" padding-left:15px"><!--@php  echo $commission;@-->%</strong></p>

</div>
<!--@php  } @-->
<!--@php  } @-->
<!--@php  } @-->
-->
<form action="javascript:addToCart(6)" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY" >

<div class="goods_number clearfix">
	<p class="name">数&nbsp;&nbsp;&nbsp;量</p>
	<div class="addForm">	
		        <input type="button" value="-" class="btn" onClick="chgNum(-1);" />	
		        <input type="text" id="total" name="number"  value="1" class="text"/>	
		        <input type="button" value="+" class="btn" onClick="chgNum(1);" />
	</div><!--@php  if($goods['istime']!=1&&$stock!=-1) { @-->(库存：<strong  id="goodstotail"><!--@php  echo $stock;@--></strong>)<!--@php  } @-->
<!--  -->
</div>


<!--@php  if($goods['hasoption']==1) { @-->
  <!--@php  if(is_array($specs)) { foreach($specs as $spec) { @-->
                  <input type='hidden' name="optionid[]" class='optionid optionid_<!--@php  echo $spec['id'];@-->' value="" title="<!--@php  echo $spec['title'];@-->">
                  <div id='option_group' class='detail-group' style="margin-top:10px;">
                      
                       <div class="detail-group">
			 
	 <span style='float:left;margin-left:15px;padding:0'><!--@php  echo $spec['title'];@--> :</span>
                        <span style="float:left;margin-left:8px;" class='options options_<!--@php  echo $spec['id'];@-->' specid='<!--@php  echo $spec['id'];@-->'>
                          
                          <!--@php  if(is_array($spec['items'])) { foreach($spec['items'] as $o) { @-->
                          
                                  <!--@php  if(empty($o['thumb'])) { @-->
                                     <span class="property option option_<!--@php  echo $spec['id'];@-->" specid='<!--@php  echo $spec['id'];@-->' oid="<!--@php  echo $o['id'];@-->"  sel='false'><!--@php  echo $o['title'];@--></span>
                                        <!--@php  } else { @-->
                                       <span class="propertyimg optionimg option_img_<!--@php  echo $spec['id'];@--> " oid="<!--@php  echo $o['id'];@-->" specid='<!--@php  echo $spec['id'];@-->' sel='false'><img src="<!--@php echo WEBSITE_ROOT;@-->/attachment/<!--@php  echo $_W['attachurl'].$o['thumb']@-->" width='50' height='70' /></span>
                                  <!--@php  } @-->
                               
                            <!--@php  } } @--> 
                        </span>
    </div>
                </div>
      <!--@php  } } @-->
         <!--@php  } @-->
</form>




<input type="hidden"  id="optionid" name="optionid" value="" />


</div>
 
 
 
 


<div class="active">
<p class="tip"></p>
</div>

<div class="card card-list">


    <div style="clear:both;"></div>
<div class="pro-info1">
<p class="pro-name1"><strong></strong></p>
</div>


 <div class="custom-store">
     
    <a class="custom-store-link clearfix" href="<!--@php  echo mobile_url('shopindex')@-->">
        <div class="custom-store-img"></div>
        <div class="custom-store-name"><!--@php  echo $cfg['shop_title'];@--></div>
        <span class="custom-store-enter">进入首页</span>
    </a>
    			
</div>  
<div class="pro-info1">
<p class="pro-name1"><strong></strong></p>
</div>


<div class="pro-detial">
	<div class="pro-intro clearfix">
		<!--@php  $good_content=$goods['content']; $good_content=str_replace("img src=","img src='__RESOURCE__/recouse/images/ajax-loader.gif' data-original=",$good_content);  echo $good_content;@-->
	
	</div>
</div>
	

<div id="buy_lay"></div>
<div id="buy_lay_frm">
	<div class="frm">
		<div class="tips">商品已添加到购物车！</div>
		<div class="btns">
			<input id="btn_continue" class="btn" type="button" value=" 再逛会 " />
			<input id="btn_check" class="btn" type="button" value=" 去结算 " />
		</div>
	</div>
</div>


<div class="btn_wrap btn_wrap_fixed" id="btnTools">
        <input type="hidden" id="favoriteId" value=""/>
               <!-- <a class="btn_fav" href="javascript:void(0);" id="collect-link"><i></i></a>    -->
        <div class="btn_col">
            <a class="btn btn_cart" href="javascript:void()" onclick='addtocart()'>加入购物车</a>
          
            <a class="btn btn_buy" href="javascript:void()" onclick='buy()'>立即购买</a>
        </div>

        <a class="cart_wrap" href="<!--@php  echo mobile_url('mycart')@-->">
            <i class="i_cart" id="cartNum"></i>
            <span class="cart"></span>
            <span class="add_num" id="popone">+1</span>
        </a>
    </div>






	
	   <script>
         
          $(function(){            
              //contact float
             
             
              $("#collect-link").on("click", function () {
                  $("#collect-tip").show();
              })
              $("#a-know").on("click", function () {
                  $("#collect-tip").hide();
              })
             
          })
      </script>

<script type="text/javascript" src="__RESOURCE__/recouse/js/iscroll.js"></script>
<script type="text/javascript">
	var myScroll;
	$(document).ready(function(){
		var w = $('.item-list ul li').length*100+'px';
		$('.item-list').width(w);
 		 myScroll = new iScroll('item-container', { 
 			snap: true,
 			hScrollbar: false,
 			vScrollbar: false,
 			momentum:false			 
 		});
	});
</script>
	</div>
</div>
</section>

	
<script type="text/javascript">
		var global_loading=document.getElementById("global_loading");
		global_loading.parentNode.removeChild(global_loading);
</script>
<script type="text/javascript">
var addto_cart_success = "该商品已添加到购物车。";
var goods_id = 6;
var goodsattr_style = 1;
var goodsId = 6;
var now_time = 1415650474;
onload = function(){
  //changePrice();
  try {onload_leftTime();}
  catch (e) {}
}

</script>
		<div class="viewport">
		<!--@php  include page('footer');@-->
	
		</div>



<script src="__RESOURCE__/recouse/js/zepto.min.js" type="text/javascript"></script>


<script type="text/javascript">
    var options=<!--@php  echo json_encode($options)@-->;
    var specs=<!--@php  echo json_encode($specs)@-->;
    var hasoption = <!--@php echo $goods['hasoption']=='1'?'true':'false'@-->;
    

        
         $(".option,.optionimg").click(function() {   
             var specid = $(this).attr("specid");
             var oid = $(this).attr("oid");
            $(".optionid_"+specid).val(oid);
         
            $(".options_" + specid + "  span").removeClass("current").attr("sel", "false");
            $(this).addClass("current").attr("sel", "true");
            var optionid = "";
            var stock =0;
            var marketprice = 0;
            var productprice = 0;
             var ret = option_selected();
  
            if(ret.no==''){
                var len = options.length;
                for(var i=0;i<len;i++) {
                    var o = options[i];
                  
                    var ids = ret.all.join("_");
                   
                    if( o.specs==ids){
                        optionid = o.id;
                        stock = o.stock;
                        marketprice = o.marketprice;
                        productprice = o.productprice;
                        break;
                    }
                    
                }
               $("#optionid").val(optionid); 
            
               <!--@php  if($stock!=-1) { @-->
              	$("#goodstotail").html(stock); 
              	<!--@php  } @-->
                $("#marketprice").html(marketprice);
                 
                 
                $("#productprice").html(productprice);
                if(productprice<=0){
                    $("#productpricecontainer").hide();
                }
                else{
                    $("#productpricecontainer").show();
                }
            }
        });
        
 
        
Zepto(function($){
   var $nav = $('.global-nav'), $btnLogo = $('.global-nav__operate-wrap');
   //点击箭头，显示隐藏导航
   $btnLogo.on('click',function(){
     if($btnLogo.parent().hasClass('global-nav--current')){
       navHide();
     }else{
       navShow();
     }
   });
   var navShow = function(){
     $nav.addClass('global-nav--current');
   }
   var navHide = function(){
     $nav.removeClass('global-nav--current');
   }
   
   $(window).on("scroll", function() {
		if($nav.hasClass('global-nav--current')){
			navHide();
		}
	});
})

function get_search_box(){
	try{
		document.getElementById('get_search_box').click();
	}catch(err){
		document.getElementById('keywordfoot').focus();
 	}
}
</script>
<script language='javascript'>
    function tip(msg,autoClose){
     var div = $("#poptip");
     var content =$("#poptip_content");
     if(div.length<=0){
         div = $("<div id='poptip'></div>").appendTo(document.body);
         content =$("<div id='poptip_content'>" + msg + "</div>").appendTo(document.body);
     }
     else{
         content.html(msg);
         content.show(); div.show();
     }
     if(autoClose) {
        setTimeout(function(){
            content.fadeOut(500);
            div.fadeOut(500);

        },1000);
     }
}
function tip_close(){
    $("#poptip").fadeOut(500);
     $("#poptip_content").fadeOut(500);
}
</script>

<script type="text/javascript">
//立即购买
var hasoption = <!--@php echo $goods['hasoption']=='1'?'true':'false'@-->;
function buy(){
    var ret = option_selected();
        if(ret.no!=''){
           tip("请选择" + ret.no + "!",true);
            return;
        }
         var total = $("#total").val();
           <!--@php  if($stock!=-1) { @-->
          if(total>parseInt($("#goodstotail").html()))
        {
        	tip("最多只能购买" + parseInt($("#goodstotail").html()) + "件!",true);
            return;
        	
        }
         	<!--@php  } @-->
     var total = $("#total").val();
     location.href = '<!--@php  echo mobile_url('confirm',array('id'=>$goods['id']),true);@-->'+"&optionid=" + $("#optionid").val() + "&total=" + total;
}
//添加到购物车
function addtocart(){
    var ret = option_selected();
        if(ret.no!=''){
           tip("请选择" + ret.no + "!",true);
            return;
        }
        
         var total = $("#total").val();
          <!--@php  if($stock!=-1) { @-->
        if(total>parseInt($("#goodstotail").html()))
        {
        	tip("最多只能购买" + parseInt($("#goodstotail").html()) + "件!",true);
            return;
        	
        }  	<!--@php  } @-->
        
        tip("正在处理数据...");
        var url = '<!--@php  echo mobile_url('mycart',array('op'=>'add','id'=>$goods['id']),true);@-->' +"&optionid=" + $("#optionid").val() + "&total=" + total;
        $.getJSON(url, function(s){
        if(s.result==0){
            tip("只能购买 " + s.maxbuy + " 件!");
        }else{
            tip_close();
				  	tip("已加入购物车!");
			//alert("已加入购物车!");
           $('#globalId').css({'width':'22px', 'height':'16px', 'line-height':'16px'}).html(s.total).animate({'width':'15px', 'height':'16px', 'line-height':'20px'}, 'slow');
           $('#carId').css({'width':'22px', 'height':'16px', 'line-height':'16px'}).html(s.total).animate({'width':'15px', 'height':'16px', 'line-height':'20px'}, 'slow');
       }
        });
}



function option_selected(){
   
     var ret= {
         no: "",
         all: []
     };
    if(!hasoption){
        return ret;
    }
            $(".optionid").each(function(){
                ret.all.push($(this).val());
                if($(this).val()==''){
                    ret.no = $(this).attr("title");
                    return false;
                }
     })
     return ret;
}
</script>


</div>
</body>
</html>